﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace QuanLyBepAnTuThien
{
    public partial class frmInLichTruc : Form
    {
        public frmInLichTruc()
        {
            InitializeComponent();
        }
        connect cn = new connect();
        private void frmInLichTruc_Load(object sender, EventArgs e)
        {
            Report.rpLichTruc rp = new Report.rpLichTruc();
            SqlCommand cmd = new SqlCommand("tblLichTruc_InDS",cn.ketnoi());
            cmd.Parameters.Add(new SqlParameter("thang", SqlDbType.Int)).Value = 1;//Convert.ToInt32(cobThang.Text);
            cmd.Parameters.Add(new SqlParameter("nam",SqlDbType.Int)).Value = DateTime.Now.Year;
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            DataTable dt = new DataTable();
            da.Fill(dt);            
            rp.SetDataSource(dt);
            rp.SetParameterValue("nguoilap",login.Hoten);
            rp.SetParameterValue("thang",cobThang.Text);
            rp.SetParameterValue("nam",DateTime.Now.Year);
            rpInLichTruc_View.ReportSource = rp;            
        }

        private void cobThang_SelectedIndexChanged(object sender, EventArgs e)
        {
            frmInLichTruc_Load(sender, e);
        }
    }
}

